
import { getIndexAsyn } from '@/api/asyn'
Page({
  data: {
    loading: true, //是否显示骨架屏
    title:'商品推荐',
    bannerList: [],
    waistAdList:[],
    goodsS: {
      page: 1,
      size: 4,
      total: 0
    },
    goodsData: {},
    goodsTypeList: [],
    goodsTypeSize:8
  },

  onLoad() {
    this.getIndexData()
  },
  async getIndexData() {
    const res = await getIndexAsyn(this.data.goodsS) as Object[]
    this.setData({
      bannerList: res[0].data.files,
      goodsData: res[1].data.records,
      goodsS: {
        page: res[1].data.pages,
        size: res[1].data.size,
        total: res[1].data.total
      },
      goodsTypeList: res[2].data,
      waistAdList: res[3].data.files,
      loading:false  
    })
  }
})
